﻿using FB.Enums;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FB.Providers.AEInfo
{
    [Table("BASE_ClientDetails", Schema = "ae")]
    public class ClientDetail : FB.Data.Models.FBAuditModel
    {
        [Key]
        [StringLength(16)]
        public string ClientCode { get; set; }

        public RecordState RecordState { get; set; }

        public int? LocationID { get; set; }

        [DataType(DataType.Text)]
        public string Remarks { get; set; }

        public virtual ICollection<ClientAccountType> AccTypes { get; set; }

        [ForeignKey("LocationID")]
        public virtual Location Location { get; set; }
    }

    [Table("BASE_ClientAccountTypes", Schema = "ae")]
    public class ClientAccountType
    {
        [Key, Column(Order = 1)]
        [StringLength(16)]
        public string ClientCode { get; set; }

        [Key, Column(Order = 2)]
        [StringLength(2)]
        public string AccType { get; set; }

        [ForeignKey("ClientCode")]
        public virtual ClientDetail ClientDetail { get; set; }
    }
}
